home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
batch
/
dink100
/
dinkey.doc
< prev
next >
Wrap
Text File
|
1990-04-25
|
5KB
|
149 lines
Dinkey v1.00
Copyright 1990 by The Thin White Duke.
Batch File Input Command.
----------
i DISCLAIMER
----------
This program comes with no warranty, expressed or otherwise. Use
of this program is at your own risk. But you have nothing to
fear from it, anyway.
This program is Shareware. Information on Registering the product
is located at the end of this file.
---------------
What is Dinkey?
---------------
Dinkey is a program to be used in batch programs for receiving input
from the user. It returns a DOS Errorlevel that can be used by your
batch programs for things like simple menus.
-----------
What to do.
-----------
Dinkey returns a DOS Errorlevel based on the user inputed key. When
you setup Dinkey in your batch program, you must tell it what the
valid keys for input are. A common selection is "YN" for Yes or No
type questions. For example:
DINKEY "YN"
This will allow the user to input a 'Y', 'y', 'N', or 'n' (or the
[ESC] or [ENTER] keys).
If the user hits a 'Y', Dinkey will return an Errorlevel of 1, since
the 'Y' is in the first position of the list of characters.
If the user had entered a 'N', Dinkey would have returned a 2, because
of the 'N' being in the second position.
The [ESC] and [ENTER] keys return the default value of 1.
Dinkey also has an optional timeout parameter. If you specify a
a number of seconds after the list of valid characters, Dinkey will
wait a maximum of that many seconds before exiting with the default
value of 1. For example:
DINKEY "ABCD" 10
This allows the user to enter a letter from A to D, within 10 seconds.
If 10 seconds pass, Dinkey will return an Errorlevel of 1 (which in
this particular case corosponds to the 'A'). If the user hits an
invalid key, such as 'Z', Dinkey will start the timeout timer over
again, giving the user another 10 seconds to select.
-----------
An Example.
-----------
The following batch program will prompt the user to select a disk drive
to use, and will then do a directory of it.
Echo off
cls
echo Which drive do you want to use? Enter A or C.
echo.
dinkey "CA" 20
IF ERRORLEVEL 2 GOTO ADRIVE
IF ERRORLEVEL 1 GOTO CDRIVE
:ADRIVE
a:
dir
echo Now Logged Onto A:
GOTO END
:CDRIVE
c:
dir
echo Now Logged Onto C:
:END
If the user selects 'C', or hits [ESC] or [ENTER], the Dinkey will
return a 1 and will cause the batch program to jump to the label
line :CDRIVE. If the user hits an 'A', the batch program will jump
to :ADRIVE. If the user waits too long (over 20 seconds), the batch
file will default to the C: drive.
Note that you must check for the Errorlevels in order from highest
to lowest. See your DOS manual for more information on batch files.
--------------------------
What Is Dinkey written In?
--------------------------
DD is written in Borland's Turbo C v1.5.
The source code can be obtained by sending $5.00 US and a disk to
the address at the end of this file.
------------------
Where To Register.
------------------
Non-Corporate users may register for $5.00 ($8.00 to have the
current version mailed to you).
Site licenses may be obtained for the following:
1 to 10 users: $15.00
11 to 30 users: $25.00
31 and greater: $45.00
Source code costs $5.00 separate, and is free with a Site
License.
Send check Payable to M. F. Oryl Jr. at the following address.
M. F. Oryl Jr.
375 Allentown Rd.
Souderton, PA 18964
If you have any questions or comments, or <shudder> 'bug'
reports, please call me at The Fire Command Center BBS and leave
me feedback or write me a letter through good ol' US mail.
The Fire Command Center
2 1 5 / 3 6 8 - 6 3 9 7
300/1200/2400bps - 24hr
-=>TTWD